#version 120 
#extension GL_EXT_geometry_shader4 : enable

uniform mat4 MVP;

varying in vec3 normal[3];
varying out vec3 color;

void main(void)
{
	float a = gl_PositionIn[0].w;
	color = mix(vec3(0.5, 0.5, 1.0), vec3(1.0, 0.5, 0.5), a);
	vec3 p = gl_PositionIn[0].xyz;
	gl_Position = MVP * vec4(p, 1.0);
	EmitVertex();
	p += normal[0];
	gl_Position = MVP * vec4(p, 1.0);
	EmitVertex();
	EndPrimitive();
}
